.class Lcom/instagram/j/r;
.super Ljava/lang/Object;
.source "MediaRenderer.java"


# direct methods
.method private static a(Landroid/content/res/Resources;Lcom/instagram/j/l;Landroid/text/SpannableStringBuilder;I)I
    .locals 5
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    const/4 v2, 0x1

    .line 196
    new-instance v0, Lcom/instagram/j/t;

    invoke-direct {v0, p0, p1}, Lcom/instagram/j/t;-><init>(Landroid/content/res/Resources;Lcom/instagram/j/l;)V

    .line 211
    invoke-virtual {p1}, Lcom/instagram/j/l;->n()Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    if-ne v1, v2, :cond_0

    .line 212
    sget v1, Lcom/facebook/ba;->view_1_comment:I

    invoke-virtual {p0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p2, v1}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 218
    :goto_0
    invoke-virtual {p2}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v1

    sub-int/2addr v1, p3

    add-int/2addr v1, p3

    const/16 v2, 0x21

    invoke-virtual {p2, v0, p3, v1, v2}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    .line 221
    const-string v0, "\n"

    invoke-virtual {p2, v0}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 223
    invoke-virtual {p2}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v0

    .line 225
    return v0

    .line 214
    :cond_0
    sget v1, Lcom/facebook/ba;->view_all_x_comments:I

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-virtual {p1}, Lcom/instagram/j/l;->n()Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {p0, v1, v2}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p2, v1}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    goto :goto_0
.end method

.method private static a(Landroid/text/SpannableStringBuilder;ILcom/instagram/j/b;)I
    .locals 5
    .parameter
    .parameter
    .parameter

    .prologue
    .line 177
    invoke-virtual {p2}, Lcom/instagram/j/b;->f()Lcom/instagram/android/model/b/e;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/android/model/b/e;->f()Ljava/lang/String;

    move-result-object v0

    .line 178
    invoke-virtual {p0, v0}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 179
    new-instance v1, Lcom/instagram/j/a;

    const-string v2, "comment_owner"

    invoke-virtual {p2}, Lcom/instagram/j/b;->f()Lcom/instagram/android/model/b/e;

    move-result-object v3

    invoke-virtual {p2}, Lcom/instagram/j/b;->l()Lcom/instagram/j/l;

    move-result-object v4

    invoke-direct {v1, v2, v3, v4}, Lcom/instagram/j/a;-><init>(Ljava/lang/String;Lcom/instagram/android/model/b/e;Lcom/instagram/j/l;)V

    .line 181
    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    add-int/2addr v0, p1

    const/16 v2, 0x21

    invoke-virtual {p0, v1, p1, v0, v2}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    .line 182
    const-string v0, " "

    invoke-virtual {p0, v0}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    move-result-object v0

    invoke-static {}, Lcom/instagram/j/g;->a()Lcom/instagram/j/g;

    move-result-object v1

    invoke-virtual {v1, p2}, Lcom/instagram/j/g;->b(Lcom/instagram/j/b;)Landroid/text/SpannableStringBuilder;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    move-result-object v0

    const-string v1, "\n"

    invoke-virtual {v0, v1}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 186
    invoke-virtual {p0}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v0

    .line 187
    return v0
.end method

.method private static a(Ljava/util/List;I)Lcom/instagram/j/b;
    .locals 5
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/instagram/j/b;",
            ">;I)",
            "Lcom/instagram/j/b;"
        }
    .end annotation

    .prologue
    .line 165
    :try_start_0
    invoke-interface {p0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/j/b;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 168
    :goto_0
    return-object v0

    .line 166
    :catch_0
    move-exception v0

    .line 167
    const-string v0, "MediaRenderer"

    const-string v1, "Attempt to get a comment that does not exist. index = %s"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 168
    const/4 v0, 0x0

    goto :goto_0
.end method

.method static a(Landroid/content/res/Resources;Lcom/instagram/j/l;)Ljava/lang/CharSequence;
    .locals 7
    .parameter
    .parameter

    .prologue
    .line 39
    invoke-virtual {p1}, Lcom/instagram/j/l;->f()Ljava/util/Set;

    move-result-object v1

    .line 42
    if-eqz v1, :cond_2

    .line 43
    invoke-interface {v1}, Ljava/util/Set;->size()I

    move-result v0

    if-nez v0, :cond_0

    .line 44
    const-string v0, ""

    .line 65
    :goto_0
    return-object v0

    .line 46
    :cond_0
    new-instance v2, Landroid/text/SpannableStringBuilder;

    invoke-direct {v2}, Landroid/text/SpannableStringBuilder;-><init>()V

    .line 47
    const/4 v0, 0x0

    .line 48
    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    move v1, v0

    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/model/b/e;

    .line 49
    invoke-virtual {v0}, Lcom/instagram/android/model/b/e;->f()Ljava/lang/String;

    move-result-object v4

    .line 50
    invoke-virtual {v2, v4}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 51
    new-instance v5, Lcom/instagram/j/a;

    const-string v6, "like_owner"

    invoke-direct {v5, v6, v0, p1}, Lcom/instagram/j/a;-><init>(Ljava/lang/String;Lcom/instagram/android/model/b/e;Lcom/instagram/j/l;)V

    .line 52
    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v0

    add-int/2addr v0, v1

    const/16 v4, 0x21

    invoke-virtual {v2, v5, v1, v0, v4}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    .line 54
    const-string v0, ", "

    invoke-virtual {v2, v0}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 55
    invoke-virtual {v2}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v0

    move v1, v0

    .line 56
    goto :goto_1

    .line 57
    :cond_1
    invoke-virtual {v2}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v0

    add-int/lit8 v0, v0, -0x2

    invoke-virtual {v2}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v1

    invoke-virtual {v2, v0, v1}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;

    move-object v0, v2

    .line 59
    goto :goto_0

    .line 60
    :cond_2
    invoke-virtual {p1}, Lcom/instagram/j/l;->d()I

    move-result v0

    if-lez v0, :cond_3

    .line 61
    invoke-static {p0, p1}, Lcom/instagram/j/r;->c(Landroid/content/res/Resources;Lcom/instagram/j/l;)Landroid/text/SpannableStringBuilder;

    move-result-object v0

    goto :goto_0

    .line 63
    :cond_3
    const-string v0, ""

    goto :goto_0
.end method

.method static a(Lcom/instagram/j/l;)Ljava/lang/CharSequence;
    .locals 5
    .parameter

    .prologue
    .line 30
    new-instance v0, Landroid/text/SpannableStringBuilder;

    invoke-direct {v0}, Landroid/text/SpannableStringBuilder;-><init>()V

    .line 31
    invoke-virtual {p0}, Lcom/instagram/j/l;->b()Lcom/instagram/android/model/b/e;

    move-result-object v1

    invoke-virtual {v1}, Lcom/instagram/android/model/b/e;->f()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 32
    new-instance v1, Lcom/instagram/j/a;

    const-string v2, "media_owner"

    invoke-virtual {p0}, Lcom/instagram/j/l;->b()Lcom/instagram/android/model/b/e;

    move-result-object v3

    invoke-direct {v1, v2, v3, p0}, Lcom/instagram/j/a;-><init>(Ljava/lang/String;Lcom/instagram/android/model/b/e;Lcom/instagram/j/l;)V

    .line 33
    const/4 v2, 0x0

    invoke-virtual {p0}, Lcom/instagram/j/l;->b()Lcom/instagram/android/model/b/e;

    move-result-object v3

    invoke-virtual {v3}, Lcom/instagram/android/model/b/e;->f()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v3

    const/16 v4, 0x21

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    .line 35
    return-object v0
.end method

.method static b(Landroid/content/res/Resources;Lcom/instagram/j/l;)Ljava/lang/CharSequence;
    .locals 17
    .parameter
    .parameter

    .prologue
    .line 88
    invoke-virtual/range {p1 .. p1}, Lcom/instagram/j/l;->z()Lcom/instagram/j/f;

    move-result-object v2

    invoke-virtual {v2}, Lcom/instagram/j/f;->c()Ljava/util/List;

    move-result-object v12

    .line 90
    new-instance v13, Landroid/text/SpannableStringBuilder;

    invoke-direct {v13}, Landroid/text/SpannableStringBuilder;-><init>()V

    .line 91
    const/4 v7, 0x0

    .line 93
    if-eqz v12, :cond_2

    invoke-interface {v12}, Ljava/util/List;->size()I

    move-result v2

    .line 95
    :goto_0
    const/4 v6, 0x0

    .line 97
    invoke-virtual/range {p1 .. p1}, Lcom/instagram/j/l;->k()Z

    move-result v3

    if-eqz v3, :cond_3

    .line 98
    const/4 v4, 0x0

    .line 99
    const/4 v3, 0x6

    invoke-static {v2, v3}, Ljava/lang/Math;->min(II)I

    move-result v3

    move v10, v3

    move v11, v4

    .line 106
    :goto_1
    if-eqz v11, :cond_0

    invoke-virtual/range {p1 .. p1}, Lcom/instagram/j/l;->k()Z

    move-result v3

    if-eqz v3, :cond_6

    :cond_0
    const/4 v3, 0x1

    move v9, v3

    .line 107
    :goto_2
    if-eqz v9, :cond_7

    const/4 v3, 0x1

    :goto_3
    add-int v14, v10, v3

    .line 109
    const/4 v3, 0x0

    move v8, v3

    :goto_4
    if-ge v8, v14, :cond_b

    .line 110
    const/4 v5, 0x0

    .line 111
    const/4 v3, 0x0

    .line 112
    if-nez v8, :cond_a

    .line 117
    const/4 v4, 0x0

    .line 118
    invoke-static {v12, v4}, Lcom/instagram/j/r;->a(Ljava/util/List;I)Lcom/instagram/j/b;

    move-result-object v4

    .line 119
    if-eqz v4, :cond_12

    .line 120
    invoke-virtual/range {p1 .. p1}, Lcom/instagram/j/l;->X()Z

    move-result v15

    if-eqz v15, :cond_9

    .line 122
    invoke-virtual {v4}, Lcom/instagram/j/b;->h()Lcom/instagram/j/e;

    move-result-object v15

    sget-object v16, Lcom/instagram/j/e;->b:Lcom/instagram/j/e;

    move-object/from16 v0, v16

    if-ne v15, v0, :cond_8

    .line 148
    :cond_1
    :goto_5
    if-eqz v4, :cond_10

    .line 149
    invoke-static {v13, v7, v4}, Lcom/instagram/j/r;->a(Landroid/text/SpannableStringBuilder;ILcom/instagram/j/b;)I

    move-result v3

    move v4, v3

    move v3, v6

    .line 109
    :goto_6
    add-int/lit8 v5, v8, 0x1

    move v8, v5

    move v6, v3

    move v7, v4

    goto :goto_4

    .line 93
    :cond_2
    const/4 v2, 0x0

    goto :goto_0

    .line 101
    :cond_3
    add-int/lit8 v3, v2, -0x6

    const/4 v4, 0x2

    if-gt v3, v4, :cond_4

    const/4 v4, 0x1

    .line 102
    :goto_7
    if-eqz v4, :cond_5

    move v3, v2

    :goto_8
    move v10, v3

    move v11, v4

    goto :goto_1

    .line 101
    :cond_4
    const/4 v4, 0x0

    goto :goto_7

    .line 102
    :cond_5
    const/4 v3, 0x6

    invoke-static {v2, v3}, Ljava/lang/Math;->min(II)I

    move-result v3

    goto :goto_8

    .line 106
    :cond_6
    const/4 v3, 0x0

    move v9, v3

    goto :goto_2

    .line 107
    :cond_7
    const/4 v3, 0x0

    goto :goto_3

    .line 124
    :cond_8
    const/4 v4, 0x1

    if-ne v14, v4, :cond_12

    .line 125
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-static {v0, v1, v13, v7}, Lcom/instagram/j/r;->a(Landroid/content/res/Resources;Lcom/instagram/j/l;Landroid/text/SpannableStringBuilder;I)I

    move-object v4, v5

    goto :goto_5

    .line 127
    :cond_9
    if-nez v11, :cond_1

    invoke-virtual {v4}, Lcom/instagram/j/b;->h()Lcom/instagram/j/e;

    move-result-object v15

    sget-object v16, Lcom/instagram/j/e;->b:Lcom/instagram/j/e;

    move-object/from16 v0, v16

    if-eq v15, v0, :cond_1

    .line 130
    const/4 v3, 0x1

    move-object v4, v5

    goto :goto_5

    .line 133
    :cond_a
    invoke-virtual/range {p1 .. p1}, Lcom/instagram/j/l;->X()Z

    move-result v4

    if-eqz v4, :cond_d

    .line 134
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-static {v0, v1, v13, v7}, Lcom/instagram/j/r;->a(Landroid/content/res/Resources;Lcom/instagram/j/l;Landroid/text/SpannableStringBuilder;I)I

    .line 157
    :cond_b
    invoke-virtual {v13}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v2

    if-lez v2, :cond_c

    .line 158
    invoke-virtual {v13}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    invoke-virtual {v13}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v3

    invoke-virtual {v13, v2, v3}, Landroid/text/SpannableStringBuilder;->delete(II)Landroid/text/SpannableStringBuilder;

    .line 160
    :cond_c
    return-object v13

    .line 136
    :cond_d
    const/4 v4, 0x1

    if-ne v8, v4, :cond_e

    if-eqz v9, :cond_e

    if-nez v6, :cond_e

    .line 137
    const/4 v3, 0x1

    move-object v4, v5

    goto :goto_5

    .line 139
    :cond_e
    if-eqz v11, :cond_f

    .line 140
    invoke-static {v12, v8}, Lcom/instagram/j/r;->a(Ljava/util/List;I)Lcom/instagram/j/b;

    move-result-object v4

    goto :goto_5

    .line 142
    :cond_f
    sub-int v4, v2, v10

    .line 143
    add-int/2addr v4, v8

    add-int/lit8 v4, v4, -0x1

    .line 144
    invoke-static {v12, v4}, Lcom/instagram/j/r;->a(Ljava/util/List;I)Lcom/instagram/j/b;

    move-result-object v4

    goto :goto_5

    .line 151
    :cond_10
    if-eqz v3, :cond_11

    .line 152
    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-static {v0, v1, v13, v7}, Lcom/instagram/j/r;->a(Landroid/content/res/Resources;Lcom/instagram/j/l;Landroid/text/SpannableStringBuilder;I)I

    move-result v4

    .line 153
    const/4 v3, 0x1

    goto/16 :goto_6

    :cond_11
    move v3, v6

    move v4, v7

    goto/16 :goto_6

    :cond_12
    move-object v4, v5

    goto/16 :goto_5
.end method

.method private static c(Landroid/content/res/Resources;Lcom/instagram/j/l;)Landroid/text/SpannableStringBuilder;
    .locals 6
    .parameter
    .parameter

    .prologue
    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 72
    new-instance v0, Landroid/text/SpannableStringBuilder;

    invoke-direct {v0}, Landroid/text/SpannableStringBuilder;-><init>()V

    .line 73
    sget v1, Lcom/facebook/ba;->number_of_people_who_like_this_photo:I

    new-array v2, v5, [Ljava/lang/Object;

    invoke-virtual {p1}, Lcom/instagram/j/l;->d()I

    move-result v3

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v2, v4

    invoke-virtual {p0, v1, v2}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 76
    new-instance v1, Lcom/instagram/j/s;

    invoke-direct {v1, v5, p1}, Lcom/instagram/j/s;-><init>(ZLcom/instagram/j/l;)V

    invoke-virtual {v0}, Landroid/text/SpannableStringBuilder;->length()I

    move-result v2

    const/16 v3, 0x21

    invoke-virtual {v0, v1, v4, v2, v3}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    .line 84
    return-object v0
.end method
